package cn.xinfei.xdecision.data.core.frame.listener;


import org.springframework.context.ApplicationEvent;

import java.io.Serializable;

public abstract class GenericEvent<T> extends ApplicationEvent implements Serializable {
    private static final long serialVersionUID = -6664541708197380616L;
    protected T data;
    private boolean success;

    public GenericEvent(Object source) {
        super(source);
    }

    public GenericEvent(Object source, T data) {
        super(source);
        this.data = data;
    }


    public GenericEvent(Object source, T data, boolean success) {
        super(source);
        this.data = data;
        this.success = success;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public boolean isSuccess() {
        return success;
    }
}
